home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1994 / MacHack 1994.toast / MacHack™94 / Talks & Papers / Timothy Knox / Help / Help Files / Miscellaneous / Gabriel Benchs < prev    next >
Text File  |  1994-06-24  |  873b  |  40 lines

  1. {••••••••••••••••••••••• Some Gabriel Benchmarks •••••••••••••••••••••••}
  2.  
  3. {••• tak •••}
  4.  
  5. (define (tak x y z)
  6.   (cond (not (<? y x))
  7.       z
  8.       (tak (tak (1- x) y z)
  9.            (tak (1- y) z x)
  10.            (tak (1- z) x y))))
  11.  
  12. {••• Timing IIci •••}
  13. (chrono (tak 18 12 6))
  14. { = [7  2.243333333333333333e+1  1.333333333333333333e+0] }
  15.  
  16. {••• Timing IIci, strictness info added •••}
  17. (setstrict tak %111)
  18. (chrono (tak 18 12 6))
  19. { = [7  1.890000000000000000e+1  5.166666666666666666e-1] }
  20.  
  21. {••• Another one, so good for lazyness !!! •••}
  22.  
  23. (define (rd2 l)
  24.   (cond (null? l) ()
  25.         (cons (0 l)(rd2 (-2 l)))))
  26.  
  27. (define (t n)
  28.   (cond (zero? n) ()
  29.         (begin (rd2 ll)(rd2 ll)(rd2 ll)(rd2 ll)(t (1- n)))))
  30.  
  31. (define (c n)
  32.   (cond (zero? n) ()
  33.         (cons () (c (1- n)))))
  34.  
  35. (define ll (c 200))
  36.  
  37. {••• try it, faster than a CRAY: lazyness -> does nothing •••}
  38. (chrono (t 300))
  39.  
  40.